package com.czxy.dao;

import com.czxy.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 查询所有首页的分类
 * @author Liuyunqin 17674029449@163.com
 * @date 2018/12/19 15:17
 */
@org.apache.ibatis.annotations.Mapper
public interface CategoryMapper extends Mapper<Category> {
    @Select("SELECT * FROM tb_category WHERE parent_id=#{parentId}")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "parent_id",property = "parentId"),
            @Result(column = "cat_Name",property = "catName")
    })
    public List<Category> findAllCategory(@Param("parentId") Integer parentId);
}
